﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit_reverse.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Game.edit_reverse" %>
<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_reverse = new TblReverseQuestionController().FetchAll().Single(x => x.Id == id);
         %>
    <header class="w3-center w3-padding-4">
        <label>Sửa câu hỏi</label>
    </header>
    <div class="w3-row w3-padding">
        <label class="w3-col l2">Tên câu hỏi</label><input id="edit_reverse_name" value="<%=get_reverse.Name %>" type="text" class="game-text w3-light-grey w3-col l10" />
    </div>
    <div class="w3-row w3-padding">
        <label class="w3-col l2">Hình ảnh câu hỏi</label>
        <input type="text" id="edit_reverse_question" value="<%=get_reverse.Question %>" class="game-text w3-light-grey w3-col l9" /><a title="Xem trước" class="game-review-img-btn w3-btn w3-teal w3-col l1"><i class="fa fa-refresh"></i></a>
    </div>
    <div class="w3-row w3-padding">
        <label class="w3-col l2">Xem trước</label>
        <div class="w3-col l10 w3-light-grey w3-center">
            <%if (get_reverse.Question.Trim() == "")
                { %>
            <img id="edit_reverse_review" src="../Content/testdata/picture/no_image.png" class="game-review-img" />
            <%}else { %>
            <img id="edit_reverse_review" src="<%=get_reverse.Question %>" class="game-review-img" />
            <%} %>
        </div>
    </div>
    <div class="w3-row w3-padding">
        <label class="w3-col l2">Đáp án</label><input id="edit_reverse_answer" value="<%=get_reverse.Answer %>" type="text" class="game-text w3-light-grey w3-col l10" />
    </div>
    <div class="w3-row w3-padding w3-center">
        <a onclick="btn_edit_reverse(<%=id %>)" class="w3-btn w3-teal"><i class="fa fa-save"></i>&nbsp;Lưu</a>
        <a onclick="game_delete_question(<%=id %>)" class="w3-btn w3-deep-orange"><i class="fa fa-trash"></i>&nbsp;Xoá câu hỏi</a>
    </div>
</body>
</html>
